package com.mxt.moviedemo.dao;

import com.mxt.moviedemo.entity.PageRequest;
import com.mxt.moviedemo.entity.Ticket;
import com.mxt.moviedemo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface TicketMapper {
    // 根据分页查询订单列表
    List<Ticket> getTicketByPage(PageRequest pageRequest);
    // 查询订单总数
    int getTotalTicket();

    List<Ticket> searchTicketByKeyword(PageRequest pageRequest, String keyword);
    int getTotalTicketByKeyword(String keyword);

    Ticket getTicketById(int tid);

    int saveTicket(Ticket ticket);

    List<Ticket> getTicketsByUsername(String username);

    List<Ticket> getTicketsByPage(PageRequest pageRequest);
    long getTotalTickets();


    List<Ticket> searchTicketsByName(String uname);
    int addTicket(Ticket ticket);
    boolean updateTicket(Ticket ticket);
    int deleteTicket(int tid);
}